-
Notifications
You must be signed in to change notification settings - Fork 13.8k
[FLINK-38866][flink-table-planner] Passing timestamp precision from window strategy to window operators to support non-compact BinaryRowData timestamps #27386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
6ffd88a to
a95006c
Compare
| int timestampPrecision, | ||
| ZoneId shiftTimeZone) { | ||
| super(windowAssigner, rowtimeIndex, shiftTimeZone); | ||
| super(windowAssigner, rowtimeIndex, timestampPrecision, shiftTimeZone); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be cleaner to keep the original method signature, and call the super(windowAssigner, rowtimeIndex,shiftTimeZone); The default then live in the WindowTableFunctionOperatorBase, rather than being specified in all the callers
The callers that need to pass the precision can use the new method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might be a bit confused on what you mean. Is the desire for a new constructor in WindowTableFunctionOperatorBase with a signature that passes timestampPrecision?
If so, the only two usages are for these two implementations, AlignedWindowTableFunctionOperator and UnalignedWindowTableFunctionOperator. Intended behavior here would be to always pass timestampPrecision through a concrete operator instance as opposed to defaulting to any given value
…dow operators to respect BinaryRowData non-compact timestamp form [FLINK-38866][flink-table-planner] Validating field precision for window descriptors Revert validation [FLINK-38866][flink-table-planner] Passing timestamp precision to window operators to respect BinaryRowData non-compact timestamp form Add test Add test Add test Add test
a95006c to
32ebe4a
Compare
|
@flinkbot run azure |
1 similar comment
|
@flinkbot run azure |
|
Hey 👋 @davidradl , it appears there's a flaky pyflink test that seems unrelated to my change. (appears to be a failure on Would you be able to trigger a re-run/ have you encountered this failure before? I've tried |
What is the purpose of the change
BinaryRowDatastores timestamps in a non-compact form when precision is > 3. Currently, window operator code hardcodes precision to 3. So, when reading back a non-compact timestamp, incorrect deserialization occurs resulting in incorrect windows.Users are only exposed to this bug when using
BinaryRowDatawith a descriptor that has precision > 3 and is running the job in batch mode.In streaming mode, descriptors must be event time attributes, which must be a precision of 3 at maximum by default.
Brief change log
StreamExecWindowTableFunctionto pass toUnalignedWindowTableFunctionOperatorCommonExecWindowTableFunctionto pass toAlignedWindowTableFunctionOperatorWindowTableFunctionOperatorBaseconstructor to take intimestampPrecisionas an int in a protected fieldAlignedWindowTableFunctionOperatorandUnalignedWindowTableFunctionOperatorconstructors to take intimestampPrecisionint argument, use it inprocessElementfor dynamically handling non-compactBinaryRowDataVerifying this change
Please make sure both new and modified tests in this PR follow the conventions for tests defined in our code quality guide.
This change added tests and can be verified as follows:
BinaryRowDataDoes this pull request potentially affect one of the following parts:
@Public(Evolving): (no)Documentation